<template>
  <div class="page-box">
     <el-button
      size="mini"
      plain
      type="primary"
      icon="el-icon-plus"
      @click="$refs.vinfo.isShow=true"
       v-permission="'sys_menu@add'"
      >{{ $t("base.add") }}</el-button
    >
    <!-- 列表 -->
    <v-list ref="vlist" @edit="edit" @childadd="childadd"></v-list>

    <!-- 添加/修改 弹框-->
    <v-info ref="vinfo"></v-info>

  </div>
</template>
<script>
import vList from './components/list'
import vInfo from './components/info'
export default {
  name: 'Menu',
  components: {
    vList, vInfo
  },
  methods: {
    // 子项添加
    childadd (val) {
      this.$refs.vinfo.formData.pid = val.id // 传入父级id
      this.$refs.vinfo.isShow = true
    },
    // 修改
    edit (val) {
      this.$refs.vinfo.getInfo(val.id)
    }
  }
}

</script>
<style scoped>

</style>
